#include "jabstractinterfacecaller.h"
#include "corelib/jasynchronization.h"

namespace QTE
{

class Q_DECL_HIDDEN JAbstractInterfaceCallerPrivate
{
public:
};

/*----------------------------------------------------------------------------------------*/

JAbstractInterfaceCaller::JAbstractInterfaceCaller(QObject *parent) :
	QObject(parent),
	d_ptr(new JAbstractInterfaceCallerPrivate())
{

}

JAbstractInterfaceCaller::~JAbstractInterfaceCaller()
{
	delete d_ptr;
}

QVariant JAbstractInterfaceCaller::call()
{
	return QVariant();
}

void JAbstractInterfaceCaller::call(const QObject *cobj, const CallBack &callBack)
{
	JAsynchronization::globalInstance()([this](){
		return analysis(call());
	},
	cobj? cobj : this, callBack);
}

void JAbstractInterfaceCaller::deleteLater()
{
	QObject::deleteLater();
}

QVariant JAbstractInterfaceCaller::analysis(const QVariant &srcData) const
{
	return srcData;
}

} //namespace QTE
